ComputerManager
Manages all registered computer instances, providing utilities to update, fetch, and interact with computer data.
Structures
ComputerClass
ComputerClass is a internal class by ScrapComputers, for documentation, you will have to look through the mod's source code as it's not intended to be used for addons.
Functions
registerComputer
sm.scrapcomputers.computerManager:registerComputer( classInstance )
Registers a new computer instance into the manager.
Arguments:
- classInstance [ ComputerClass ] Instance of the computer being registered.
Returns:
- id [ integer ] Unique ID of a registered computer.
getTotalComputers
sm.scrapcomputers.computerManager:getTotalComputers()
Gets the total number of computers currently registered in the world.
Returns:
- amount [ integer ] Total registered computers.
getAllComputers
sm.scrapcomputers.computerManager:getAllComputers()
Returns a list of all registered computer IDs.
Returns:
- ids [ integer[] ] All registered computer ids.
computerExists
sm.scrapcomputers.computerManager:computerExists( id )
Checks whether a computer ID exists.
Arguments:
- id [ integer ] The computer ID.
Returns:
- [ boolean ] Wether the computer exists or not.
getFilesystemOfComputer
sm.scrapcomputers.computerManager:getFilesystemOfComputer( id )
Fetches the shared filesystem of a computer.
Arguments:
- id [ integer ] The computer ID.
Returns:
- filesystem [ Computer.Filesystem ] The computer’s filesystem instance.
forceSyncFilesystem
sm.scrapcomputers.computerManager:forceSyncFilesystem( id )
Forcefully syncs a computer’s filesystem to its storage and clients.
Use this if you need immediate synchronization before regular events occur.
Arguments:
- id [ integer ] The computer ID.